<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<script type="text/javascript">
	$(document).ready(function(){
		var status=1;
		/* $("#regForm").submit(function(){			
			 if($(":input[name=memberId]").val()==""){
				alert("아이디를 입력하세요");				
				return false;
			} 
			if($(":input[name=memberPassword]").val()==""){
				alert("패스워드를 입력하세요");				
				return false;
			}
			if($(":input[name=memberName]").val()==""){
				alert("이름을 입력하세요");				
				return false;
			}
			if($(":input[name=memberNickname]").val()==""){
				alert("닉네임을 입력하세요");				
				return false;
			}	
			if(status>0){
				alert("아이디 중복확인하세요!");				
				return false;
			}
		}); */
		$("#id").keyup(function(){
			status="fail";
			var id=$("#id").val();
			if(id.length<4 || id.length>10){
				$("#idCheckView").html("아이디는 4자이상 10자 이하여야 함!").css(
						"background","pink");
				return;
			}
			$.ajax({
				type:"POST",
				url:"${initParam.root}member/idcheckAjax.moja",
				data:"memberId="+id,
				success:function(data){	 				
					if(data>0){//0보다 크면 아이디가 존재
					$("#idCheckView").html(id+" 사용불가!").css("background","red");
					}else{
						$("#idCheckView").html(id+" 사용가능!").css(
								"background","yellow");						
					}
					status=data;
				}//callback			
			});//ajax
		});//keyup
	});//ready
</script>    

<br><br>
<div id="mainCss" align="center">
<table border="1">
<form id="regForm" action="${initParam.root}member/register.moja" method="post">
<tr>
<td colspan="3" bgcolor="black" align="center"><br><font color="#FFFFFF" size="4">회 원 가 입</font><br><br></td>
</tr>
<tr>
<td ><font color="red">*</font>ID </td>
<td><input type="text" name="memberId" id="id" >
<br>(4자 이상 10자이상)
</td>
<td width="300">중복체크 : <span id="idCheckView"></span></td>
</tr>
<tr>
<td><font color="red">*</font>Password</td>
<td colspan="2"><input type="password" name="memberPassword"></td>
</tr>
<tr>
<td><font color="red">*</font>Name</td>
<td><input type="text" name="memberName"></td>
<td>※ 실명을 입력해주시기 바랍니다.</td>
</tr>
<tr>
<td>Nickname</td>
<td colspan="2"><input type="text" name="memberNickname"></td>
</tr>
<tr>
<td><font color="red">*</font>Birthday</td>
<td colspan="2"><input type="date" name="memberBirthday"></td>
</tr>
<tr>
<td><font color="red">*</font>Gender</td>
<td colspan="2">남자 <input type="radio" name="memberGender" value="남자">
여자<input type="radio" name="memberGender" value="여자"></td>
</tr>
<tr>
<td><font color="red">*</font>Email</td>
<td colspan="2"><input type="email" name="memberEmail"></td>
</tr>
<tr>
<td><font color="red">*</font>Phone</td>
<td ><input type="tel" name="memberPhone"></td>
<td>※ 특수기호없이 숫자만 입력해주세요.</td>
</tr>
<tr>
<td colspan="3">
<div align="center">
<font color="red">*</font>는 필수입력사항입니다!!<br>
<input type="submit" value="회원가입">
</div>
</td>
</tr>
</form>
</table>
</div>












